import request from '../utils/request'

export const getClazzPage = (params) =>
  request({ url: '/clazz', method: 'get', params })

export const addClazz = (data) =>
  request({ url: '/clazz', method: 'post', data })

export const updateClazz = (data) =>
  request({ url: '/clazz', method: 'put', data })

export const deleteClazz = (id) =>
  request({ url: `/clazz/${id}`, method: 'delete' })

export const batchDeleteClazz = (ids) =>
  request({ url: '/clazz/batch', method: 'delete', data: ids })

// 班级导出（axios 方式）
export const exportClazz = () =>
  request({
    url: '/clazz/export',
    method: 'get',
    responseType: 'blob' // 关键：告诉 axios 返回二进制流
  })